<div id="announcementManagement">
  <yu-panel title="公告管理">
    <yu-xform ref="queryForm" label-width="110px" related-table-name="announcementTable" form-type="search"
              :custom-search-fn="searchFn">
      <yu-xform-group :column="4">
        <yu-xform-item label="公告名称" placeholder="公告名称"
                       ctype="input" name="boardName"></yu-xform-item>
        <yu-xform-item label="公告状态" placeholder="公告状态" ctype="select"
                       name="boardStatus" data-code="ANNOUNCEMENT_STATUS"></yu-xform-item>
      </yu-xform-group>
      <div>
        <yu-button type="warning" @click="lookupInformation('detail')" >查询基本信息</yu-button>
        <yu-button type="danger" @click="addFn()">新增</yu-button>
        <yu-button type="success" @click="lookupInformation('edit')">修改</yu-button>
        <yu-button type="danger" @click="deleteFn()">删除</yu-button>
        <yu-button type="primary" @click="publishFn()">发布</yu-button>
      </div>                                                                                                   
      <div style="height: 30px"></div>
      <yu-xtable :data-url="funcDataUrl" ref="announcementTable" row-number style="width: 100%" selection-type="checkbox" :selectable="select">
        <yu-xtable-column prop="boardName" label="公告名称" width="90px"  align="center"></yu-xtable-column>
        <yu-xtable-column prop="boardLoad" label="公告下载" width="130px"  align="center" >
          <template slot-scope="scope">
            <a v-if="scope.row.boardLoad !==''" :href="scope.row.boardLoad+'?response-content-type=application/octet-stream'" download="scope.row.boardLoadName">点击下载</a>
          </template>
        </yu-xtable-column>
        <yu-xtable-column prop="boardPubtime" label="发布时间" width="150px"  align="center"></yu-xtable-column>
        <yu-xtable-column :formatter="dateFormat" prop="createTime" label="创建时间" width="150px"  align="center"></yu-xtable-column>
        <yu-xtable-column  prop="boardContent" label="公告内容" width="500px"  align="center"></yu-xtable-column>
        <yu-xtable-column prop="boardStatus" data-code="ANNOUNCEMENT_STATUS" label="公告状态" width="100px"  align="center"></yu-xtable-column>
        <yu-xtable-column prop="boardPublisher" label="发布人" width="120px"  align="center"></yu-xtable-column>
      </yu-xtable>
    </yu-xform>
  </yu-panel>
  <!-- 弹出框-->
  <el-dialog-x :center="true" title="客户基本信息" :visible.sync="dialogFormVisible" position="relative" height="360px" width="800px">
    <div style="display: flex;height: auto;position: relative;transition: all .5s;flex-direction: column">
      <div style="padding-left: 18px;margin-bottom: 30px;height: 35px;display: flex;align-items: center;width: 98%;border-bottom: 2px solid #D8D8D8">
      <div style="color: #D8D8D8;font-size: 13px;margin-right: 5px">发布时间</div>
      <div style="color: #D8D8D8;font-size: 13px;margin-right: 5px;">{{createTime}}</div>
      <div style="margin-left: 40px;color: #D8D8D8;font-size: 13px;margin-right: 5px;">发布人</div>
      <div style="color: #D8D8D8;font-size: 13px;margin-right: 5px;">{{boardPublisher}}</div>
    </div>
      <el-form-x :disabled="!changeInputDisabled(dialogType)" ref="modForm" :group-fields="modFields"  label-width="100px"></el-form-x>
      <el-upload :disabled="!changeInputDisabled(dialogType)" :before-upload="beforeUpload" class="upload-demo" style="display: flex;margin-left: 30px" :limit="1" :headers="headers" ref="upload" :action="action"
                 :on-success="onSuccess" :auto-upload="true" :show-file-list="true" :file-list="fileList">
        <el-button slot="trigger" type="primary" >点击上传</el-button>
      </el-upload>
      <div slot="footer" class="dialog-footer" align="center">
        <el-button v-if="changeInputDisabled(dialogType)" type="primary" @click="saveEditFunc()">保存</el-button>
        <el-button v-if="changeInputDisabled(dialogType)"  @click="restInputValue()">取消</el-button>
      </div>
    </div>
  </el-dialog-x>
</div>
